<?php

namespace App\Models\Admin;

class ListField extends Base
{
    protected $table = 'list_field';

    public $timestamps = false;

    protected $guarded = [];

    public static function getListField($type):array
    {
        $info = self::where('type',$type)->where(function ($query){
            $query->where('company_id',0);
        })->orderBy('id','DESC')->first();
        if (empty($info->fields)) return [];
        $fields = json_decode($info->fields,true);
        return $fields;
    }
}
